Saul's possession
When Samuel anointed David, the Spirit of the LORD left Saul, and a harmful spirit from the LORD tormented him. His servants suggested they bring David to soothe him with the lyre, and Saul came to love David and made him his armor-bearer. Saul sent to Jesse, requesting David stay in his service. David played the lyre whenever the harmful spirit tormented him, and the spirit fled. (1 Samuel 16:13-23)
The Philistines were between Socoh and Azekah in Ephes-dammim, while Saul's army was in the Valley of Elah. No one braved Goliath's challenge for 40 days until David arrived and asked the soldiers about the uncircumcised Philistine who defied the army of the living God. Saul heard of him and sent for him, but when he offered to fight Goliath, he told him he was a youth against a man who was a soldier from his youth. The boy responded that the LORD who delivers him from lions and bears will deliver him from a giant. Saul clothed him with his armor and sword, but he rejected them, defeating the giant with a staff, a sling, and five stones. The Philistines were chased and plundered from Shaaraim to Gath and Ekron. Saul asked Abner, commander of his army, who the youth's father was, but he didn't learn until he returned and Abner brought him to Saul, Goliath's head in hand: the son of your servant Jesse the Bethlehemite. (1 Samuel 17)
Saul gains David as son-in-law
Saul took David and did not let him return to his father's house. He set David over the men of war, but when he went to the cities of Israel, he heard the song on the women's lips that Saul struck down thousands and David ten thousands. He was very angry and wondered what more David could have but the kingdom. He eyed David from that day on.
The next day, the harmful spirit returned. He raved while David played the lyre. Saul had his spear in his hand premeditatively. He hurled it at David twice. He removed David from his presence and installed him as commander of a thousand, but this increased his success and popularity such that Saul was in fearful awe.
Saul was to give Merab to David if he would but be valiant and fight the LORD's battles (and hopefully die), but David declined due to his name. Merab was given to another when David was to marry. Saul learned Michal loved David, so he offered her as another snare. He commanded his servants to convince David to marry. When they shared David's unwillingness due to poverty and reputation, Saul offered the preferable bride-price of a hundred foreskins (and hopefully his own death). He received 200. He gave him Michal, but David with the LORD and loving Michal scared Saul even more. When the princes of the Philistines came out to battle, none of his servants had more success than David. (1 Samuel 18)